<template>
    <!-- 正在直播 -->
    <div class="live-component-container">
        <div class="live-component-title">正在直播</div>
        <router-link class="live-component-content" v-if="type=='1'"
                     :to="{name: 'Live', params: {'channelid': info[0].channelId, 'programid': info[0].id}}">
            {{info[0].programName}}
        </router-link>
        <div class="live-component-icon" v-if="type=='1'">
            <router-link
                    :to="{name: 'Live', params: {'channelid': info[0].channelId, 'programid': info[0].id}}">
                <img src="../assets/images/triangle-left.png"/>
            </router-link>
        </div>

        <router-link class="live-component-content" v-if="type=='2'"
                     :to="{name: 'Show', params: {'channelid': info[0].channelId, 'programid': info[0].id}}">
            {{info[0].programName}}
        </router-link>
        <div class="live-component-icon" v-if="type=='2'">
            <router-link
                    :to="{name: 'Show', params: {'channelid': info[0].channelId, 'programid': info[0].id}}">
                <img src="../assets/images/triangle-left.png"/>
            </router-link>
        </div>
    </div>
</template>

<script>
    export default {
        props: {
            info: {
                type: Array,
                default: function () {
                    return [];
                }
            },
            type: {
                type: String
            }
        },
    }
</script>

<style>
    .live-component-container {
        width: 100%;
        height: 2.4rem;
        margin: 0.4rem auto;
    }

    .live-component-title {
        width: 10%;
        height: 2.4rem;
        float: left;
        font-size: 0.9rem;
        font-weight: bold;
        color: #FF753F;
        line-height: 1.2rem;
    }

    .live-component-content {
        display: block;
        width: 79%;
        float: left;
        font-size: 0.9rem;
        height: 2.4rem;
        line-height: 1.2rem;
        margin-left: 0.1rem;
        font-weight: bold;
        text-decoration: none;
        color: #444444;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .live-component-icon {
        width: 10%;
        float: right;
        height: 2.4rem;
        line-height: 2.4rem;
        text-align: center;
    }

    .live-component-icon a {
        display: block;
        width: 1.5rem;
        height: 1.5rem;
        line-height: 2.4rem;
    }

    .live-component-icon a img {
        width: 100%;
    }
</style>